package com.example.demo.config;

import org.springframework.core.annotation.Order;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

/**
 * @author Administrator
 * @className wuyp
 * @description:
 * @Date 2022/3/30 11:04
 **/
@org.springframework.web.bind.annotation.ControllerAdvice
@Order(10000)
public class ControllerAdvice {
    @InitBinder
    public void setAllowedFields(WebDataBinder
                                         dataBinder) {
        String[] abd = new String[] {"class.*",
                "Class.*","*.class.*","*.Class.*"};
        dataBinder.setDisallowedFields(abd);
        System.out.println("--調用了--");
    }
}
